#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n;
void solve()
{
	cin>>n;
	string s;
	cin>>s;

	for(int i=0;i<n;i++)
	{
		if(i!=n-1&&s[i]=='L'&&s[i+1]=='R') cout<<"LR",i++;
		else if(i!=n-1&&s[i]=='R'&&s[i+1]=='L') cout<<"RL",i++;
		else if(i!=n-1&&s[i]=='U') cout<<"D";
		else if(i!=n-1&&s[i]=='D') cout<<"U";
		else if(i==n-1)
		{
			if(s[i]=='R') cout<<'L';
			else if(s[i]=='L') cout<<'R';
			else if(s[i]=='D') cout<<'U';
			else if(s[i]=='U') cout<<'D';
		}	 	 
	}
	cout<<'\n';


	
}

int main()
{
	close();
	int T; cin>>T;
	while (T--) solve();
	return 0;
}